import { Deduplication } from "./Deduplication";
export default function styletexttocssrulesstring(styletext: string): string[] {
    let style = document.createElement("style");
    let doc = document.implementation.createHTMLDocument("");
    style.textContent = styletext;
    doc.head.appendChild(style);
    const stylesheet = style.sheet;
    if (!stylesheet) {
        throw Error("style sheet not found");
    }
    return Deduplication(Array.from(stylesheet.cssRules).map((a) => a.cssText));
}
